package com.ruoyi.acs.tr069;
import com.ruoyi.dbi.util.SystemParameters;
import com.ruoyi.acs.tr069.http.HTTPRequestResponseData;
import lombok.Data;

@Data
public class CommandKey {
    private String cpeKey;
    private String serverKey;

    public void setServerKey(HTTPRequestResponseData reqRes) {
        this.serverKey =
                reqRes.getSessionData().getUnit().getParameterValue(SystemParameters.JOB_CURRENT_KEY);
    }

    public boolean isEqual() {
        return serverKey == null
                || serverKey.trim().isEmpty()
                || (cpeKey != null && cpeKey.equals(serverKey));
    }
}
